<?php
session_start();
include 'includes'.DIRECTORY_SEPARATOR.'functions.php';
db() ;

$header_information_q = mysql_query('SELECT level,rep,power,money,smart,life,referal,energy FROM users WHERE user="'.$_SESSION['user_info']['user'].'"');
$header_information = mysql_fetch_assoc($header_information_q);

$level = $header_information['level'];
$rep = $header_information['rep'];
$power = $header_information['power'];
$energy = $header_information['energy'];
$money = $header_information['money'];
$smart = $header_information['smart'];
$life = $header_information['life'];
$referal = $header_information['referal'];
$me = $_SESSION['user_info']['user'];	

	if($_GET['action']=="drinkc"){
	
					mysql_query('UPDATE users SET money=money-5,energy=energy+20 WHERE user="'.$me.'"') ;
					mysql_query('UPDATE menus SET drink_c='.time().' WHERE user="'.$me.'"');
					echo "Вие получихте 20 енергия." ; 
				
				
	}
	elseif($_GET['action']=="brokem"){
		
		mysql_query('UPDATE users SET money=money+20,rep=rep+1,power=power+1,energy=energy-10 WHERE user="'.$me.'"');
		mysql_query('UPDATE menus SET broke_m='.time().' WHERE user="'.$me.'"');
		echo 'Вие получихте: $20,1 репотация,1 сила,-10 енергия';
	}
	elseif($_GET['action']=="learn"){
		mysql_query('UPDATE users SET smart=smart+1 WHERE user="'.$me.'"');
		mysql_query('UPDATE menus SET learn='.time().' WHERE user="'.$me.'"');
		echo 'Вие получихте 1 интелигентност';
	}
	elseif($_GET['action']=="facebook"){
		mysql_query('UPDATE users SET rep=rep+1 WHERE user="'.$me.'"');
		mysql_query('UPDATE menus SET facebook='.time().' WHERE user="'.$me.'"');
		echo 'Вие получихте 1 репутация';
	}
	elseif($_GET['action']=="brokec"){
		mysql_query('UPDATE users SET rep=rep+1 WHERE user="'.$me.'"');
		mysql_query('UPDATE menus SET broke_c='.time().' WHERE user="'.$me.'"');
		echo 'Вие получихте 1 репутация';
	}
	elseif($_GET['action']=="talk"){
		mysql_query('UPDATE users SET rep=rep+1 WHERE user="'.$me.'"');
		mysql_query('UPDATE menus SET talk='.time().' WHERE user="'.$me.'"');
		echo 'Вие получихте 1 репутация';
	}
	
	
	
	
	
	
	
	
	
	
		